def trace(func):
    def wrapper(*args, **kwargs):
        result = func(*args, **kwargs)
        print(f"{func.__name__}({args!r}, {kwargs!r}) -> {result!r}")
        return result

    return wrapper


fibonaccis = {0: 0, 1: 1}


@trace
def fibonacci(n):
    if n in fibonaccis:
        return fibonaccis[n]
    result = fibonacci(n - 2) + fibonacci(n - 1)
    fibonaccis[n] = result
    return result


print(fibonacci(6))
